Skip to content

feat(attributes): Add browser.bfcache.* attributes - #513

Open
logaretm wants to merge 3 commits into
mainfrom
feat/bfcache-attributes
Open

feat(attributes): Add browser.bfcache.* attributes#513
logaretm wants to merge 3 commits into
mainfrom
feat/bfcache-attributes

Conversation

@logaretm

@logaretm logaretm commented Jul 20, 2026

Copy link
Copy Markdown
Member

Registers the four browser.bfcache.* attributes emitted by the new bfcacheMetricsIntegration in the JS SDK (getsentry/sentry-javascript#22397).

They describe browser back/forward-cache health metrics.

Attribute Description
browser.bfcache.outcome hit/miss of a back/forward navigation.
browser.bfcache.reason A browser-reported not-restored reason (one per reason; a single miss can have several; Chromium-only via notRestoredReasons).
browser.bfcache.frame Which frame the reason came from (top/child).
browser.bfcache.not_restored_reason_count Number of reported reasons (0 when the browser reported none, e.g. non-Chromium).

All are Sentry-specific, so is_in_otel: false and PII is not applicable here.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Attributes

  • Add browser.bfcache.* attributes by logaretm in #513
  • Add aws.request.url (deprecated) in favor of url.full by sentrivana in #488
  • Add subprocess.pid (deprecated) in favor of process.pid by sentrivana in #487
  • Add litestar.middleware_name (deprecated) in favor of middleware.name by sentrivana in #486
  • Add starlette.middleware_name (deprecated) in favor of middleware.name by sentrivana in #485
  • Add redis.key (deprecated) in favor of db.redis.key by sentrivana in #484
  • Add db.mongodb.collection (deprecated) in favor of db.collection.name by sentrivana in #483
  • Add Kafka messaging attributes by chargome in #474
  • Deprecate rpc.grpc.status_code in favor of rpc.response.status_code by lucas-zimerman in #494
  • Add deprecated messaging.destination_kind by andreiborza in #509
  • Add sentry.segment.name.source attribute by Lms24 in #466
  • Add attribute transformations by constantinius in #465
  • Add stable app vitals attributes by buenaflor in #493
  • Deprecate sentry.frames.* attributes by buenaflor in #500
  • Add missing AI legacy aliases from Relay SpanData by vgrozdanic in #498

Other

  • (conventions) Support multiple examples by Lms24 in #505
  • (descriptions) Add http.route description template for http.server span description inference by Lms24 in #518

Internal Changes 🔧

Attribute

  • Add more examples for valid sentry.kind values by Lms24 in #517
  • Improve db.statement example and add deprecation reason by Lms24 in #501

Attributes

  • Improve description of sentry.segment.name.source by Lms24 in #511
  • Deprecate sentry.span.source and change backfill status of sentry.source by Lms24 in #510

Deps

  • Bump dompurify from 3.4.11 to 3.4.12 by dependabot in #525
  • Bump fast-uri from 3.1.2 to 3.1.4 by dependabot in #526
  • Bump svgo from 4.0.1 to 4.0.2 by dependabot in #524
  • Bump js-yaml from 4.2.0 to 4.3.0 by dependabot in #516
  • Bump astro from 6.4.7 to 7.1.0 in /docs by dependabot in #514

Other

  • (attrs) Backport attributes and normalizations from Relay by Dav1dde in #497
  • (codeowners) Assign telemetry-experience to gen_ai/ai attributes by vgrozdanic in #506
  • (deps-dev) Bump tar from 7.5.16 to 7.5.19 by dependabot in #515
  • (release) Show version in workflow run title by constantinius in #504

🤖 This preview updates automatically when you update the PR.

logaretm added 2 commits July 23, 2026 12:55
Registers the four attributes emitted by the new bfcacheMetricsIntegration
in the JS SDK: browser.bfcache.outcome, browser.bfcache.reason,
browser.bfcache.frame, and browser.bfcache.not_restored_reason_count.
All are Sentry-specific (not in OTel).
The SDK frames reasons purely by position; 'masked' is a reason value, not
a frame, so drop it (and 'unknown') from the frame attribute.
@logaretm
logaretm force-pushed the feat/bfcache-attributes branch from 4074543 to 03cc94e Compare July 23, 2026 16:55
@logaretm
logaretm marked this pull request as ready for review July 23, 2026 17:07
@logaretm
logaretm requested review from a team, Lms24, cleptric, mjq and nsdeschenes as code owners July 23, 2026 17:07

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The attribute names look very reasonable to me, so no objections to adding them from my end! We should adjust the apply_scrubbing behaviour though (see comment).

"brief": "Which frame in the page's frame tree a back/forward cache not-restored reason originated from: the top document or a child frame.",
"type": "string",
"apply_scrubbing": {
"key": "never"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"key": "never"
"key": "manual"

I 100% agree that Pii isnt a concern here but we should only set never if product functionality would break if the attribute value got scrubbed. Which I think isn't the case. It would break created BF-cache dashboards but users would have to do their part for this to happen. So I'd suggest we set "manual". Meaning if users configure this field to be scrubbed (for whatever reason) it will be scrubbed. Otherwise, it will be left as-is. More details: https://develop.sentry.dev/engineering-practices/sentry-conventions/#before-opening-a-pr

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, thanks for the clarification!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 8a15474

@logaretm
logaretm requested a review from Lms24 July 24, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants